package com.luhuiguo.cms.server.converter;

import org.dozer.DozerConverter;

import com.google.appengine.api.datastore.Text;

/**
 * 
 * @author LuHuiguo
 * @version $Id: TextConverter.java 83 2010-03-15 14:51:52Z luhuiguo@gmail.com $
 */
public class TextConverter extends DozerConverter<Text, String> {

    public TextConverter() {
        super(Text.class, String.class);
    }

    @Override
    public Text convertFrom(String source, Text destination) {
        if (null == source) {
            return null;
        }
        return new Text(source);
    }

    @Override
    public String convertTo(Text source, String destination) {
        if (null == source) {
            return null;
        }
        return source.getValue();
    }

}
